package com.coffee.mongodb;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotEmpty;

/**
 * @author: songkui
 * @since: 2022/5/5 23:11
 */
@Validated
@Component
@ConfigurationProperties(prefix = "spring.data.mongodb")
public class MochaMongoPoolProperties {
        @NotEmpty
        private String appName;

        private int connectionTimeoutMs = 30000;
        private int readTimeoutMs = 20000;

        private int maxSize;
        private int minSize;

        public String getAppName() {
                return appName;
        }

        public void setAppName(String appName) {
                this.appName = appName;
        }

        public int getConnectionTimeoutMs() {
                return connectionTimeoutMs;
        }

        public void setConnectionTimeoutMs(int connectionTimeoutMs) {
                this.connectionTimeoutMs = connectionTimeoutMs;
        }

        public int getReadTimeoutMs() {
                return readTimeoutMs;
        }

        public void setReadTimeoutMs(int readTimeoutMs) {
                this.readTimeoutMs = readTimeoutMs;
        }

        public int getMaxSize() {
                return maxSize;
        }

        public void setMaxSize(int maxSize) {
                this.maxSize = maxSize;
        }

        public int getMinSize() {
                return minSize;
        }

        public void setMinSize(int minSize) {
                this.minSize = minSize;
        }
}
